﻿; ----------------------------------------------
;        <<  声明常量  >>
; ----------------------------------------------
; 加载模板 \ 宽 136u * 高 113u
!define MUI_UI "resource\uimod.exe"


; ----------------------------------------------
;        <<  声明变量  >>
; ----------------------------------------------
Var Transparent

Var hCtl__Green
Var hCtl__Green_ComboBox

Var hCtl__Green_Bitmap
Var hCtl__Green_Bitmap_hImage


; ----------------------------------------------
;        <<  创建自定义界面  >>
; ----------------------------------------------
Function fnc__Green_Create
  nsDialogs::Create 1018

  ;消除边框
  ; System::Call `user32::SetWindowLong(i$HWNDPARENT,i${GWL_STYLE},0x9480084C)i.R0`

  ; 透明
  ${If} $Transparent < '60'
    StrCpy $Transparent "100"
  ${EndIf}
  IntOp $R8 $Transparent * 255
  IntOp $R8 $R8 / 100
  System::Call "user32::SetWindowPos(i $HWNDPARENT, i -1, i0, i0, i0, i0, i 3)"
  StrCpy $R2 $R8  ;透明度（0-255）
  System::Call 'User32::GetWindowLong(i $HWNDPARENT, i -20) .iR0'
  IntOp $R0 $R0 + 0x80000
  System::Call 'User32::SetWindowLong(i $HWNDPARENT, i -20, i R0) .iR1'
  System::Call 'User32::SetLayeredWindowAttributes(i $HWNDPARENT, i 0, i R2, i 2) .i R0'

  ; 隐藏最大化 & 最小化
  System::Call 'user32::GetWindowLong(i $hwndparent,i -16)i.r0'
  ; 0x70000 / 0x60000 / 0x30000  最大化 & 最小化 不可用
  ; 0x80000 ~  关闭X 不可用
  intop $1 0x30000 ~
  intop $0 $0 & $1
  System::Call 'user32::SetWindowLong(i $hwndparent,i -16,i $0)i'


  ;隐藏一些既有控件
  GetDlgItem $0 $HWNDPARENT 1034
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1035
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1036
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1037
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1038
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1039
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1256
  ShowWindow $0 ${SW_HIDE}
  GetDlgItem $0 $HWNDPARENT 1028
  ShowWindow $0 ${SW_HIDE}

  Pop $hCtl__Green
  ${If} $hCtl__Green == error
    Abort
  ${EndIf}
  SetCtlColors $hCtl__Green 0x000000 0xFFFFFF

  ; 左右 上下 宽 高

  ${NSD_CreateIcon} 6u 1u 21u 19u ""                      ; 图标

  ${NSD_CreateLabel}  33u 1u 93u 15u "Title"              ; 标题
  ${NSD_CreateLabel}  33u 16u 93u 9u "SubTitle"           ; 副标题

  ${NSD_CreateGroupbox} 3u 22u 130u 64u ""                ; 框架

  ${NSD_CreateButton} 14u 30u 108u 19u "Install"          ; 按钮

  ${NSD_CreateCheckBox} 18u 52u 104u 11u "CheckBox 1"     ; 复选框
  ${NSD_CreateCheckBox} 18u 62u 104u 11u "CheckBox 2"
  ${NSD_CreateCheckBox} 18u 72u 104u 11u "CheckBox 3"

  ${NSD_CreateHLine} 3u 88u 130u 5u "HLine"               ; 分隔线

  ${NSD_CreateLink} 8u 98u 30u 9u "Link"                  ; 链接
  ${NSD_CreateButton} 74u 96u 49u 13u "退出"              ; 退出

  ${NSD_CreateBitmap} 0u 85u 136u 35u ""
  Pop $hCtl__Green_Bitmap
  SetCtlColors $hCtl__Green_Bitmap 0x000000 0xF5F5F5

FunctionEnd


; ----------------------------------------------
;        <<  显示自定义界面  >>
; ----------------------------------------------
Function fnc__Green_Show
  Call fnc__Green_Create
  nsDialogs::Show $hCtl__Green
FunctionEnd

